﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title id="Description">RangeSelector - Background Image</title>
    <link type="text/css" rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" />
    <style type="text/css">
        #backgroundImage {
            width: 500px;
            height: 100px;
            background: url(../../images/imageNature5.jpg) -100px -100px;
        }
    </style>
    <script type="text/javascript" src="../../scripts/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../../scripts/demos.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxrangeselector.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            // create jqxRangeSelector.
            $("#rangeSelector").jqxRangeSelector({
                width: 500, height: 100, min: new Date(2014, 5, 1), max: new Date(2014, 9, 1), range: { from: new Date(2014, 5, 1), to: new Date(2014, 6, 29), min: { days: 7 } },
                majorTicksInterval: "week", minorTicksInterval: "day", labelsFormat: 'dd', markersFormat: 'd', showGroupLabels: true
            });
            // create jqxButton.
            $("#submit").jqxButton();
            $("#submit").click(function () {
                var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
                var range = $("#rangeSelector").jqxRangeSelector("getRange");
                var fromDate = range.from.getDate();
                var fromMonth = range.from.getMonth();
                var toDate = range.to.getDate();
                var toMonth = range.to.getMonth();
                $("#result").text("Vacation period selected: from " + months[fromMonth] + " " + fromDate + " to " + months[toMonth] + " " + toDate);
            });
        });
    </script>
</head>
<body>
    <div>
        <div id="rangeSelector">
            <div id="jqxRangeSelectorContent">
                <img id="backgroundImage" src="../../images/transparent.png" />
            </div>
        </div>
        <button style="margin-left:80px; margin-top: 20px;" id="submit">
            Submit vacation</button>
        <div style="margin-left:80px; margin-top: 10px;"id="result">
        </div>
    </div>
</body>
</html>
